<?php

namespace app\common\model;

class Template extends BaseModel
{
    protected $append = ['type_name'];

    public function project()
    {
        return $this->belongsTo(Project::class);
    }

    public function getTypeNameAttr($value,$data)
    {
        $temp = [
            1 => "诉状",
            2 => "鉴定报告",
            3 => "公证书",
        ];
        return $temp[$data['template_type']] ?? '';
    }
}